{% extends "layout.html" %}
{% from 'model/macros.html' import uri_field, lit_field, icon_tag with context %}
{% block header %}
    <h1 class="title">
        <a href="/browse/type/{{ lii_type }}">{{ lii_type }}</a>:
        &nbsp;{{ value(rsrc, nsc['skos'].prefLabel) }}
    </h1>
{% endblock %}
{% block body %}
    {% set pref_rep = value(rsrc, nsc['lii'].hasPreferredRepresentation) %}
    {% if pref_rep %}
      <div class="pref_image">
          <img src="/image/{{ basename(pref_rep) }}/full/!800,400/0/default.jpg" />
      </div>
    {% endif %}
    {{ lit_field(values(rsrc, nsc['skos'].scopeNote), 'Description', True) }}
    {% block type_metadata %}{% endblock %}
    {% block neighbor_graph %}
        <section class="neighbor_graph">
            <h2>Neighborhood Graph</h2>
            {{ draw_neighbor_graph(rsrc) | safe }}
            <p>Click on linked elements for details.</p>
        </section>
    {% endblock %}
    {% block rel_media %}
        {% if rel_media %}
            <section>
                <h2>Related Media</h2>
            {% for agg, ars in rel_media %}
                <div class="gallery" id="{{agg.uid}}">
                    <h5><a href="/view/{{ agg.uid }}">
                        {{ value(agg, nsc['skos'].prefLabel) }}
                    </a></h5>
                  {% for uid, label, _ in ars %}
                      <a class="gallery_item" href="/view{{ uid }}">
                          {{ icon_tag(uid) }}
                          <span class="icon_label">{{ label | e }}</span>
                      </a>
                  {% endfor %}
                </div>
            {% endfor %}
            </section>
        {% endif %}
    {% endblock %}
{% endblock %}
